# !/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
from django.conf import settings


def md5(data_string):
    # salt = "xxx".encode("utf-8") 这里我们不用这个，用Django自带的

    obj = hashlib.md5(settings.SECRET_KEY.encode("utf-8"))

    obj.update(data_string.encode("utf-8"))

    return obj.hexdigest()
